#! -*- coding: utf-8 -*-
from datetime import datetime
from sqlalchemy import Column, Integer, String, DateTime, Text, ForeignKey, LargeBinary
from sqlalchemy.ext.declarative import declarative_base


Base = declarative_base()

class BaseModel(Base):
    __abstract__ = True
    id = Column(Integer, primary_key=True, autoincrement=True, comment="ID")


class CdcAccessInfo(BaseModel):
    __tablename__ = "access_info"
    __table_args__ = {"comment": "权限表"}
    f_access = Column(String(255), nullable=False, default="N/A", comment="权限名称")


class CdcUserInfo(BaseModel):
    __tablename__ = "user_info"
    __table_args__ = {"comment": "用户表"}
    f_username = Column(String(255), nullable=False, default="N/A", comment="用户名称")
    f_password = Column(String(255), nullable=False, default="N/A", comment="用户密码")
    f_access_name = Column(String(255), nullable=True, default="N/A", comment="权限名称")
    f_display_name = Column(String(255), nullable=True, default="N/A", comment="昵称")
    f_email = Column(String(255), nullable=True, default="N/A", comment="邮箱")
    f_token = Column(String(255), nullable=True, default="N/A", comment="令牌")
    f_update = Column(DateTime, nullable=True, default=datetime.now, comment="更新时间")

    f_access_id = Column(Integer, ForeignKey("access_info.id"), comment="权限ID")


class CdcBaseInfo(BaseModel):
    __tablename__ = "base_info"
    __table_args__ = {"comment": "基础信息表"}
    f_sid = Column(String(255), nullable=False, default="N/A", comment="学号")
    f_name = Column(String(255), nullable=True, default="N/A", comment="姓名")
    f_gender = Column(String(255), nullable=True, default="N/A", comment="性别")
    f_academy = Column(String(255), nullable=True, default="N/A", comment="书院")
    f_major = Column(String(255), nullable=True, default="N/A", comment="专业名称")
    f_gpa = Column(String(255), nullable=True, default="N/A", comment="CGPA")
    f_grade = Column(String(255), nullable=True, default="N/A", comment="年级")
    f_graduation_pre_term = Column(String(255), nullable=True, default="N/A", comment="预毕业学期")
    f_graduation_pre_year = Column(DateTime, nullable=True, default=datetime.now, comment="预毕业年份")
    f_phone = Column(String(255), nullable=True, default="N/A", comment="联系方式")
    f_email = Column(String(255), nullable=True, default="N/A", comment="邮箱")
    f_status = Column(String(255), nullable=True, default="N/A", comment="学籍状态")
    f_enrollment_type = Column(String(255), nullable=True, default="N/A", comment="招生类型")
    f_credit_status = Column(String(255), nullable=True, default="N/A", comment="修分情况")
    f_warn_info = Column(String(255), nullable=True, default="N/A", comment="预警信息")
    f_advisor = Column(String(255), nullable=True, default="N/A", comment="顾问")


class CdcResumeInfo(BaseModel):
    __tablename__ = "resume_info"
    __table_args__ = {"comment": "简历信息表"}
    f_sid = Column(String(255), nullable=True, default="N/A", comment="学号")
    f_resume_name = Column(String(255), nullable=True, default="N/A", comment="简历名称")
    f_resume_path = Column(String(255), nullable=True, default="N/A", comment="简历路径")
    f_resume_data = Column(LargeBinary, comment="简历数据")

    f_sid_id = Column(Integer, ForeignKey("base_info.id"), comment="学号ID")


class CdcBackgroundInfo(BaseModel):
    __tablename__ = "background_info"
    __table_args__ = {"comment": "背景信息表"}
    f_sid = Column(String(255), nullable=False, default="N/A", comment="学号")
    f_graduate_plan = Column(String(255), nullable=True, default="N/A", comment="毕业计划")

    f_intend_employment_area = Column(String(255), nullable=True, default="N/A", comment="意向就业地区")
    f_intend_employment_industry = Column(String(255), nullable=True, default="N/A", comment="意向就业行业")
    f_intend_employment_position = Column(String(255), nullable=True, default="N/A", comment="意向就业岗位")
    f_intend_study_area = Column(String(255), nullable=True, default="N/A", comment="意向升学岗位")
    f_intend_study_school = Column(String(255), nullable=True, default="N/A", comment="意向升学院校")
    f_intend_study_major = Column(String(255), nullable=True, default="N/A", comment="意向升学领域")
    f_gre_gmat = Column(String(255), nullable=True, default="N/A", comment="GRE/GMAT")
    f_ielts_toefl = Column(String(255), nullable=True, default="N/A", comment="IELTS/TOEFL")
    f_chinese_level = Column(String(255), nullable=True, default="N/A", comment="中文水平")

    f_sid_id = Column(Integer, ForeignKey("base_info.id"), comment="学号ID")


class CdcActivityInfo(BaseModel):
    __tablename__ = "activity_info"
    __table_args__ = {"comment": "活动信息表"}
    f_sid = Column(String(255), nullable=False, default="N/A", comment="学号")
    f_activity_time = Column(DateTime, nullable=True, default=datetime.now, comment="活动时间")
    f_activity_type = Column(String(255), nullable=True, default="N/A", comment="活动类型")
    f_activity_name = Column(String(255), nullable=True, default="N/A", comment="活动名称")
    f_remark = Column(Text, nullable=True, default="N/A", comment="备注")

    f_sid_id = Column(Integer, ForeignKey("base_info.id"), comment="学号ID")


class CdcInternshipInfo(BaseModel):
    __tablename__ = "internship_info"
    __table_args__ = {"comment": "实习信息表"}
    f_sid = Column(String(255), nullable=False, default="N/A", comment="学号")
    f_start_time = Column(DateTime, nullable=True, default=datetime.now, comment="开始时间")
    f_end_time = Column(DateTime, nullable=True, default=datetime.now, comment="结束时间")
    f_company = Column(String(255), nullable=True, default="N/A", comment="公司")
    f_position = Column(String(255), nullable=True, default="N/A", comment="职位")
    f_location = Column(String(255), nullable=True, default="N/A", comment="地点")

    f_sid_id = Column(Integer, ForeignKey("base_info.id"), comment="学号ID")


class CdcOfferInfo(BaseModel):
    __tablename__ = "offer_info"
    __table_args__ = {"comment": "Offer信息表"}
    f_sid = Column(String(255), nullable=False, default="N/A", comment="学号")
    f_offer_type = Column(String(255), nullable=True, default="N/A", comment="Offer类型")
    f_offer_area = Column(String(255), nullable=True, default="N/A", comment="Offer地区")
    f_company_college_name = Column(String(255), nullable=True, default="N/A", comment="企业/学校")
    f_position_project_name = Column(String(255), nullable=True, default="N/A", comment="职位/项目")
    f_project_type = Column(String(255), nullable=True, default="N/A", comment="项目类型")
    f_salary_month = Column(String(255), nullable=True, default="N/A", comment="月薪")
    f_salary_year = Column(String(255), nullable=True, default="N/A", comment="年薪")
    f_accept_status = Column(String(255), nullable=True, default="N/A", comment="接受情况")
    f_remark = Column(String(255), nullable=True, default="N/A", comment="备注")

    f_sid_id = Column(Integer, ForeignKey("base_info.id"), comment="学号ID")


class CdcKeyInfo(BaseModel):
    __tablename__ = "key_info"
    __table_args__ = {"comment": "关键信息表"}
    f_sid = Column(String(255), nullable=False, default="N/A", comment="学号")
    f_apecial_attention = Column(String(255), nullable=True, default="N/A", comment="特需生")
    f_difficulty_type = Column(String(255), nullable=True, default="N/A", comment="困难类型")
    f_support_need = Column(String(255), nullable=True, default="N/A", comment="跨部门支持")
    f_support_info = Column(String(255), nullable=True, default="N/A", comment="支持内容")
    f_parents_contacted = Column(String(255), nullable=True, default="N/A", comment="联系家长")

    f_sid_id = Column(Integer, ForeignKey("base_info.id"), comment="学号ID")


class CdcGraduateInfo(BaseModel):
    __tablename__ = "graduate_info"
    __table_args__ = {"comment": "毕业信息表"}
    f_sid = Column(String(255), nullable=False, default="N/A", comment="学号")
    f_province_system_report = Column(String(255), nullable=True, default="N/A", comment="是否填报省厅系统")
    f_graduate_registe_report = Column(String(255), nullable=True, default="N/A", comment="是否填报毕业生登记表")

    f_sid_id = Column(Integer, ForeignKey("base_info.id"), comment="学号ID")


class CdcDailyInfo(BaseModel):
    __tablename__ = "daily_info"
    __table_args__ = {"comment": "CDC记录表"}
    f_sid = Column(String(255), nullable=False, default="N/A", comment="学号")
    f_owner = Column(String(255), nullable=True, default="N/A", comment="记录人")
    f_type = Column(String(255), nullable=True, default="N/A", comment="类型")
    f_time = Column(DateTime, nullable=True, default=datetime.now, comment="时间")
    f_detail = Column(Text(255), nullable=True, default="N/A", comment="详情")

    f_sid_id = Column(Integer, ForeignKey("base_info.id"), comment="学号ID")


class CdcSchoolProgramArea(BaseModel):
    __tablename__ = "school_program_area"
    __table_args__ = {"comment": "学校&项目&地区表"}
    f_school = Column(String(255), nullable=True, default="N/A", comment="学校")
    f_program = Column(String(255), nullable=True, default="N/A", comment="项目")
    f_area = Column(String(255), nullable=True, default="N/A", comment="地区")


class CdcBoxGraduateRegisteReport(BaseModel):
    __tablename__ = "box_graduate_registe_report"
    __table_args__ = {"comment": "毕业登记表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxProvinceSystemReport(BaseModel):
    __tablename__ = "box_province_system_report"
    __table_args__ = {"comment": "填报省厅系统表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxParentsContacted(BaseModel):
    __tablename__ = "box_parents_contacted"
    __table_args__ = {"comment": "联系家长表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxDifficultyType(BaseModel):
    __tablename__ = "box_difficulty_type"
    __table_args__ = {"comment": "困难类型表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxApecialAttention(BaseModel):
    __tablename__ = "box_apecial_attention"
    __table_args__ = {"comment": "特需表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxOfferState(BaseModel):
    __tablename__ = "box_offer_state"
    __table_args__ = {"comment": "Offer状态表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxEntranceYear(BaseModel):
    __tablename__ = "box_entrance_year"
    __table_args__ = {"comment": "入学年份表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxProjectType(BaseModel):
    __tablename__ = "box_project_type"
    __table_args__ = {"comment": "项目类型表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxChineseLevel(BaseModel):
    __tablename__ = "box_chinese_level"
    __table_args__ = {"comment": "中文水平表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxOfferType(BaseModel):
    __tablename__ = "box_offer_type"
    __table_args__ = {"comment": "Offer类型表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxGraduatePlan(BaseModel):
    __tablename__ = "box_graduate_plan"
    __table_args__ = {"comment": "毕业计划表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxMajor(BaseModel):
    __tablename__ = "box_major"
    __table_args__ = {"comment": "专业信息表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxArea(BaseModel):
    __tablename__ = "box_area"
    __table_args__ = {"comment": "留学地区表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxRecordType(BaseModel):
    __tablename__ = "box_record_type"
    __table_args__ = {"comment": "记录类型表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxEnrollmentType(BaseModel):
    __tablename__ = "box_enrollment_type"
    __table_args__ = {"comment": "招生类型表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxEnrollmentStatus(BaseModel):
    __tablename__ = "box_enrollment_status"
    __table_args__ = {"comment": "学籍状态表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxAdvisor(BaseModel):
    __tablename__ = "box_advisor"
    __table_args__ = {"comment": "顾问表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxExportOptions(BaseModel):
    __tablename__ = "box_export_options"
    __table_args__ = {"comment": "导出选项表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")


class CdcBoxImportOptions(BaseModel):
    __tablename__ = "box_import_options"
    __table_args__ = {"comment": "导入选项表"}
    f_value = Column(String(255), nullable=True, default="N/A", comment="值")
